<?php
// +----------------------------------------------------------------------
// | Author: derek <693472824@qq.com> <http://www.bloveambition.com/>
// +----------------------------------------------------------------------

namespace Api\Model;
use Think\Model\ViewModel;

/**
 * 订单模型层
 * derek <693472824@qq.com>
 */
class OrdersViewModel extends ViewModel {

    protected $viewFields = array(

        'UserAddress'   =>  array(
                            'contact', 'telphone', 'sex', 'address', 'name'
        ),
        
        'Orders'   =>  array(
                            'order_id', 'user_id', 'address_id', 'site_id', 'order_no', 'emergency', 'delay', 'appointment', 
                            'remark', 'order_type', 'sender', 'worker_id', 'start_time', 'end_time', 'service_time', 'status', 'create_time',
                            'reason', 'total', 'rate_price', 'turnover',
                            '_on'=>'UserAddress.address_id=Orders.address_id'
        ),
            
        'ClassDetail'    =>  array(
                            'detail_id', 'detail_name', 'price',
                            '_on'=>'Orders.detail_id = ClassDetail.detail_id'
        )
    );
}